import time
def sortirovka(A):
    N=len(a)
    for i in range(N-1):
        for j in range(N-2, i-1, -1):
            if A[j+1]<A[j]:
                A[j], A[j+1]=A[j+1], A[j]
Fin1=open("m1_sorted.txt")
a=Fin1.readlines()
A=list(map(int,a))
t_start=time.time()
sortirovka(A)
t_finish=time.time()
print("m1_sorted", round ((t_finish-t_start)*1000), "milliseconds")

Fin2=open("m2_reverse.txt")
a=Fin2.readlines()
A=list(map(int,a))
t_start=time.time()
sortirovka(A)
t_finish=time.time()
print("m2_reverse", round ((t_finish-t_start)*1000), "milliseconds")

Fin3=open("m3_shuffle.txt")
a=Fin3.readlines()
A=list(map(int,a))
t_start=time.time()
sortirovka(A)
t_finish=time.time()
print("m3_shuffle", round ((t_finish-t_start)*1000), "milliseconds")
